<?php
session_start();
?>
<!DOCTYPE html>
<html>
 <head>
  <meta charset="UTF-8"> 
   <link type="text/css" rel="stylesheet" href="../css/index.css">
    <title>Wintersporttag - Anmeldung</title>
	<script type="text/javascript" src="../java/moomenu.js" ></script>
    <script type="text/javascript" src="../java/e53a815ab435.js" ></script>	
    <script type="text/javascript" src="../java/jquery.min.js" ></script>
    <script type="text/javascript" src="../java/jqFancyTransitions.js"></script>
	<script type="text/javascript">
	<!--
	function FensterWechsel()
	{
	parent.location.href="backendindex.php";
	}
	function FensterWechsel2()
	{
	parent.location.href="Neu_Kennworteingabe.html";
	}

	// -->
	</script>
 </head>
  <body>
       
    <img src="../bilder/Alber-Schaeffle-Schule.bmp" alt="Text"/>
      <div class="titel">
	  <div id="slideshow">
	<div class="bild">
	<img  src="../java/images/bild1.jpg" alt="" />
<img src="../java/images/bild2.jpg" alt="" />
<img src="../java/images/bild3.jpg" alt=""  />
<img src="../java/images/bild4.jpg" alt=""  />
<img src="../java/images/bild5.jpg" alt=""  />
<img src="../java/images/bild6.jpg"  alt=""  />
</div>
<script type="text/javascript">
$('#slideshow').jqFancyTransitions({ width: 735, height: 139, delay: 2500, effect: 'fade', direction: 'alternate', stripDelay: 80, strips: 20});
</script>
	
	</div>
	 	    
	 </div>
	   
<div class="inhalt">

<?php
$nutzer = $_SESSION['kuerzel'];
$pwneu1 = $_POST['pwNeupasswort'];
$pwneu2 = $_POST['pwNeupasswort2'];


if($nutzer != NULL AND $pwneu1!= NULL AND $pwneu2 != NULL )
{
if($pwneu1 == $pwneu2)
{

if (!$link = mysql_connect ('localhost', 'dennis', 'dennis'))
{
	echo "Keine Verbindung zu mysql";
}

if (!mysql_select_db('dennis_schuelerdaten', $link))
{
	echo "konnte DB nicht finden";
}
else
{
$sql="UPDATE lehrer SET PasswortNeu='$pwneu1' where Kuerzel='$nutzer'";
mysql_query("SET NAMES 'utf8'");
$result = mysql_query($sql,$link);
echo "<body onLoad='FensterWechsel();'>";
echo"</body>";

}
mysql_close($link);
}


else
{
echo "<center>Die Passwörter stimmen nicht überein";
echo "<br><br><INPUT TYPE=BUTTON VALUE='Zurück' onClick='history.back()'></center>";
}
}
else
{
echo "<center>Bitte füllen Sie alle Felder aus!";
echo "<br><br><INPUT TYPE=BUTTON VALUE='Zurück' onClick='history.back()'></center>";

}


?>
</div>
</body>
</html>